﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;


namespace KunURP.Editor
{
    public class KunHeaderDecorator : KunSubDrawer
    {
        public string Header { get; private set; }
        public KunHeaderDecorator() : this("", "") {}
        public KunHeaderDecorator(string group) : this(group, "") {}
        public KunHeaderDecorator(string group, string header) : base(group)
        {
            this.Header = header;
        }

        public override void DrawShaderProperty(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
        {
            GUIStyle style = new GUIStyle(EditorStyles.boldLabel);
            style.fontSize += 3;
            var rect = EditorGUILayout.GetControlRect(true, 30);

            EditorGUI.LabelField(rect, new GUIContent(this.Header), style);
        }
    }
}

